package com.wwl.cms.utils.designModeTest.mediator.smarthouse;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/26 16:04
 * @description:
 */
//具体的同事类
public class Alarm extends Colleague {
    //构造器
    public Alarm(Mediator mediator,String name){
        super(mediator,name);
        //在创建Alam同事对象时，将自己放入到ConcreteMediator对象中
        mediator.Register(name,this);
    }

    public void SendAlarm(int stateChange){
        SendMessage(stateChange);
    }

    @Override
    public void SendMessage(int stateChange){
        //调用的中介者对象的
        this.GetMediator().GetMessage(stateChange,this.name);

    }

}
